package com.ustc.py.learn.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ustc.py.learn.entity.Knowledge;
import com.ustc.py.learn.entity.KnowledgeVo;


import java.util.List;


public interface KnowledgeService extends IService<Knowledge> {




    /**
     * 根据知识类型和类型下章节号，查询知识ID，即主键knowledgeId
     * @param knowledgeType
     * @param chapterIds
     * @return
     */
    List<Integer> getBatchKnowledgeIdsByKnowledgeTypeAndChapterIds(int knowledgeType, List<Integer> chapterIds);

    /**
     * 根据知识类型查询所有可用的菜单项
     * @param knowledgeType
     * @return
     */
    List<KnowledgeVo> getKnowledgeMenuList(int knowledgeType);

    /**
     * 根据knowledgeId查询知识详情
     * @param knowledgeId
     * @return
     */
    KnowledgeVo getKnowledge(int knowledgeId);

    Knowledge getKnowledgeById(int id);

    List<KnowledgeVo> getChapter(Integer typeId, Integer chapterId);

    /**
     * Knowledge表的通用模糊搜索
     * @param typeId 知识类型id  可参见 KnowledgeTypeEnum
     * @param keyword 搜索关键词
     * @return
     * Jackiehan is in charge.
     */
    List<KnowledgeVo> search(Integer typeId, String keyword);
}
